<?php

/* Serve output ******/
if(strpos(@$_SERVER['HTTP_ACCEPT'], 'xhtml') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false)
	header('content-type: application/xhtml+xml; charset=utf-8');
else
	header('content-type: text/html; charset=utf-8');

#$rev = intval(preg_replace('/^\D+/', '', '$Rev: 158 $'));
echo '<'.'?xml version="1.0" encoding="utf-8"?'.">\n";

?>
<!DOCTYPE html><!-- XHTML5 -->
<!--
Copyright 2009, OpenScriptures.org
GPL 3 license: http://www.gnu.org/licenses/gpl.html
-->
<html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="http://www.bibletechnologies.net/2003/OSIS/namespace">
	<head>
		<!--[if IE]>
		<meta charset="utf-8" />
		<script>
		//HTML5 enabling script for IE. For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/
		(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while (i-=1){document.createElement(e[i])}})()
		</script>
		<![endif]-->
		
		<title><?php
		$title = wp_title(' | ', false, 'right');
		if ( is_wp_error( $title ) )
			return $title->get_error_message();
		echo apply_filters('get_wp_title_rss', $title) . get_bloginfo('name');
		?></title>
		<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
		<?php if($_SERVER['REQUEST_URI'] == '/'): ?>
			<meta name="description" content="<?php echo htmlspecialchars(get_bloginfo('description')) ?>" />
		<?php elseif($wp_query->get_queried_object() && !empty($wp_query->queried_object->post_excerpt)): ?>
			<meta name="description" content="<?php echo htmlspecialchars($wp_query->queried_object->post_excerpt) ?>" />
		<?php endif; ?>
		
		<?php if(!preg_match('{MSIE [123456]\D}', $_SERVER['HTTP_USER_AGENT'])): ?>
		<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>?<?php echo filemtime(TEMPLATEPATH . '/style.css') ?>" type="text/css" media="screen" />
		<?php endif; ?>
		
		<link rel="<?php if(is_home()):?>alternate <?php endif; ?>feed" title="<?php bloginfo('name'); ?> Blog Feed" type="application/rss+xml" href="http://feeds2.feedburner.com/open-scriptures" />
		<link rel="feed" title="<?php bloginfo('name'); ?> Twitter Stream" type="application/rss+xml" href="http://twitter.com/statuses/user_timeline/22411269.rss" />
		
		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
		<link rel="shortcut icon" href="/favicon.png" type="image/png" />
		<?php if(is_singular()): ?>
			<link href="<?php trackback_url(); ?>" rel="trackback" />
			<link href="<?php echo get_post_comments_feed_link(); ?>" title="Comments feed for <?php echo htmlspecialchars(get_the_title()) ?>" rel="feed" type="application/rss+xml" />
		<?php endif; ?>
	
		<?php wp_head(); ?>
	</head>
	<body class="<?php
	if(is_home())
		echo 'home';
	else if(is_page())
		echo 'page';
	else if(is_single())
		echo 'single';
	else if(is_search())
		echo 'search';
	else if(is_category())
		echo 'category';
	?>">
	
		<?php if(preg_match('{MSIE [123456]\D}', $_SERVER['HTTP_USER_AGENT'])): ?>
		<p style="background-color:#FFCCCC; padding:1em; border:dotted 1px red; margin-left:auto; margin-right:auto; ">
			<strong>Notice:</strong> You appear to be using MSIE 6, an obsolete web browser. To view this site you should upgrade to <a href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx">Internet Explorer 7/8</a>, or try
			<a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a>,
			<a href="http://www.apple.com/safari/">Apple Safari</a>,
			<a href="http://www.opera.com/">Opera</a>,
			or
			<a href="http://www.google.com/chrome">Google Chrome</a> <small>(administrator rights not needed to install Chrome)</small>.
		</p>
		<?php endif; ?>
		
		<header>
			<h1><a href="<?php echo get_option('home'); ?>/" rel="home" title="Open Scriptures home page"><img src="/logo.png" alt="Open Scriptures logo: an open Bible" /><?php bloginfo('name'); ?></a></h1>
			<h2><?php bloginfo('description'); ?> <a href="/about/" title="About the Open Scriptures project">More…</a></h2>
		</header>
		<nav>
			<ul>
			<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
				<?php //wp_list_pages('title_li=&sort_column=menu_order&depth=1' ); ?>
				<li><h3><a href="/about/">About the Project</a></h3>
				<ul>
					<li class='icon feed'><a rel="feed" type="application/rss+xml" href="http://feeds2.feedburner.com/open-scriptures" title="Subscribe to the Open Scriptures blog">Blog Feed</a></li>
					<li class='icon google-groups'><a href="http://groups.google.com/group/open-scriptures" title="Join in the discussion at the Open Scriptures Google Group">Discussion Group</a></li>
					<!--<li><a href="http://code.google.com/p/open-scriptures/issues/list">Report Issues</a></li>-->
					<li class='icon twitter'><a href="http://twitter.com/openscriptures" title="Follow openscriptures on Twitter">Twitter Stream</a></li>
					<li class='icon delicious'><strong><a href="/directory/" title="Find resources relaing to Open Scriptures">Directory</a></strong></li>
					<li class='icon google-code'><a href="http://code.google.com/p/open-scriptures/" title="Check out the project source code on Google Code">Project Source Code</a></li>
				</ul>
				</li>
				
				<li><h3>Prototypes</h3>
					<ul>
						<li><a href="/prototypes/manuscript-comparator/"><strong>Manuscript Comparator</strong> <img src="/wp-content/uploads/manuscript-comparator-unified-view-150x150.png" alt="Manuscript Comparator screenshot" style="display:block" /></a></li>
						<li><a href="/prototypes/reference-parser-test.php">Reference Parser</a></li>
						<li><a href="/prototypes/work-viewer/">Work Viewer</a></li>
					</ul>
				</li>
			<?php endif; ?>
			</ul>
		
			<?php if(false): ?>
			
			<ul>

				
				<?php //wp_list_bookmarks('title_li=&sort_column=menu_order&depth=1&title_before=<h3>&title_after=</h3>' ); ?>
			</ul>
			<?php endif; ?>
		</nav>
